import Vue from "vue";
import Router from "vue-router";
import HelloWorld from "@/components/notUse/HelloWorld";
import Login from "../components/Login.vue";
import Main from "../components/Main.vue";
import AddAccount from "../components/backAccount/AddAccount.vue";
import ShowAccount from "../components/backAccount/ShowAccount.vue";
import BackLogin from "../components/notUse/BackLogin.vue";
import BackLogin1 from "../components/notUse/BackLogin1.vue";
import AddBookType from "../components/backBookType/AddBookType.vue";
import ShowBookType from "../components/backBookType/ShowBookType.vue";
import AddBookInfo from "../components/backBookInfo/AddBookInfo.vue";
import ShowBookInfo from "../components/backBookInfo/ShowBookInfo.vue";
import model from "../components/notUse/model.vue";
import UserIndex from "../components/userInfo/UserIndex.vue";
import showUbookInfo from "../components/userInfo/BookInfo/showUbookInfo.vue";
import showCollectList from "../components/userInfo/Other/showCollectList.vue";
import ShowSingleBookInfo from "../components/userInfo/BookInfo/ShowSingleBookInfo.vue";
import ShowShoppingCar from "../components/userInfo/Other/ShowShoppingCar.vue";
import SingleInfo from "../components/userInfo/SingleInfo.vue";
import ShowOrderList from "../components/userInfo/Order/ShowOrderList.vue";
import ShowSingleOrder from "../components/userInfo/Order/ShowSingleOrder.vue";
import ShowOrderInfo from "../components/backOrderInfo/ShowOrderInfo.vue";
import ShowOrderRefund from "../components/backOrderInfo/ShowOrderRefund.vue";
import ShowUserAddress from "../components/userInfo/Other/ShowUserAddress.vue";
import ShowUserOrderRefund from "../components/userInfo/Order/ShowOrderRefund.vue";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/showUbookInfo"
    },
    {
      path: "/login",
      component: Login
    },
    {
      path: "/main",
      component: Main,
      children: [
        {
          path: "/admin/addAccount",
          component: AddAccount
        },
        {
          path: "/admin/showAccount",
          component: ShowAccount
        },
        {
          path: "/admin/addBookType",
          component: AddBookType
        },
        {
          path: "/admin/showBookType",
          component: ShowBookType
        },
        {
          path: "/admin/addBookInfo",
          component: AddBookInfo
        },
        {
          path: "/admin/showBookInfo",
          component: ShowBookInfo
        },
        {
          path:"/admin/showOrderInfo",
          component:ShowOrderInfo
        },
        {
          path:"/admin/showOrderRefund",
          component:ShowOrderRefund
        }
      ]
    },
    {
      path: "/backLogin",
      component: BackLogin
    },
    {
      path: "/backLogin1",
      component: BackLogin1
    },
    {
      path: "/model",
      component: model
    },
    {
      path: "/userIndex",
      component: UserIndex,
      children: [
        {
          path: "/showUbookInfo",
          component: showUbookInfo
        },
        {
          path:"/showCollectList",
          component:showCollectList
        },
        {
          path:"/showSingleBookInfo",
          component:ShowSingleBookInfo
        },
        {
          path:"/showShoppingCar",
          component:ShowShoppingCar
        },
        {
          path:"/singleInfo",
          component:SingleInfo
        },
        {
          path:"/showOrderList",
          component:ShowOrderList
        },
        {
          path:"/showSingleOrder",
          component:ShowSingleOrder
        },
        {
          path:"/showUserAddress",
          component:ShowUserAddress
        },
        {
          path:"/showUserOrderRefund",
          component:ShowUserOrderRefund
        }
      ]
    }
  ]
});
